import folium
import requests


#scale
My_map = folium.Map(
    location=(-38.625, -12.875),
    tiles="cartodb positron",
    control_scale=True,
)
#folium.Map((45.5236, -122.6750), tiles="cartodb positron")
folium.Marker(
    location=[45.3288, -121.6625],
    tooltip="Click me!",
    popup="Mt. Hood Meadows",
    icon=folium.Icon(icon="cloud"),
).add_to(My_map)

folium.Marker(
    location=[45.3311, -121.7113],
    tooltip="Click me!",
    popup="Timberline Lodge",
    icon=folium.Icon(color="green"),
).add_to(My_map)

trail_coordinates = [
    (-71.351871840295871, -73.655963711222626),
    (-71.374144382613707, -73.719861619751498),
    (-71.391042575973145, -73.784922248007007),
    (-71.400964450973134, -73.851042243124397),
    (-71.402411391077322, -74.050048183880477),
]

folium.PolyLine(trail_coordinates, tooltip="Coast").add_to(My_map)

group_1 = folium.FeatureGroup("first group").add_to(My_map)
folium.Marker((0, 0), icon=folium.Icon("red")).add_to(group_1)
folium.Marker((1, 0), icon=folium.Icon("red")).add_to(group_1)

group_2 = folium.FeatureGroup("second group").add_to(My_map)
folium.Marker((0, 1), icon=folium.Icon("green")).add_to(group_2)
'''
geojson_data = requests.get(
    "https://raw.githubusercontent.com/python-visualization/folium-example-data/main/world_countries.json"
).json()

folium.GeoJson(geojson_data, name="hello world").add_to(My_map)
'''

folium.LayerControl().add_to(My_map)

My_map.save('./map.html')
